/**
 * related to index.ui
 * 
 * @Author : 18668972585
 * @Timestamp : 2017-06-02
 ******************************************************************************/
var viewshower = ui("viewshower");
var page = sm("do_Page");
viewshower.addViews([ {
	id : "main",// 页面的标示
	path : "source://view/main/main.ui"// 页面的路径
}, {
	id : "zhibo",
	path : "source://view/zhibo/index.ui"
}, {
	id : "huizhen",
	path : "source://view/huizhen/index.ui"
}, {
	id : "my",
	path : "source://view/my/index.ui"
} ]);
// 初始化先显示第一个页面
viewshower.showView("main");

var button1 = ui("do_Button_1");
var imageview1 = ui("do_ImageView_1");
var label1 = ui("do_Label_1");
button1.on("touch", function() {
	showView("main");
});

var button2 = ui("do_Button_2");
var imageview2 = ui("do_ImageView_2");
var label2 = ui("do_Label_2");
button2.on("touch", function() {
	showView("zhibo");
});

var button3 = ui("do_Button_3");
var imageview3 = ui("do_ImageView_3");
var label3 = ui("do_Label_3");
button3.on("touch", function() {
	showView("huizhen");
});

var button4 = ui("do_Button_4");
var imageview4 = ui("do_ImageView_4");
var label4 = ui("do_Label_4");
button4.on("touch", function() {
	showView("my");
});

function showView(name) {
	viewshower.showView(name);
	if (name == "main") {
		imageview1.source = "source://image/mian/jingdusele.png";
		label1.fontColor = "FF7F00FF";
	} else {
		imageview1.source = "source://image/mian/jingdu.png";
		label1.fontColor = "9F9F9FFF";
	}

	if (name == "zhibo") {
		imageview2.source = "source://image/mian/zhibosele.png";
		label2.fontColor = "FF7F00FF";
	} else {
		imageview2.source = "source://image/mian/zhibo.png";
		label2.fontColor = "9F9F9FFF";
	}

	if (name == "huizhen") {
		imageview3.source = "source://image/mian/huizhensele.png";
		label3.fontColor = "FF7F00FF";
	} else {
		imageview3.source = "source://image/mian/huizhen.png";
		label3.fontColor = "9F9F9FFF";
	}

	if (name == "my") {
		imageview4.source = "source://image/mian/wodesele.png";
		label4.fontColor = "FF7F00FF";
	} else {
		imageview4.source = "source://image/mian/wode.png";
		label4.fontColor = "9F9F9FFF";
	}
}